<%@ Page language="c#" Codebehind="PageSelector.aspx.cs" AutoEventWireup="True" Inherits="CrossFactory.SiteNote.XmlEditor.PageSelector" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD runat="server">
		<title>Page Selector</title>
		<meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<LINK href="../Admin/StyleSheets/PageSelector.css" type="text/css" rel="stylesheet">
		<script language="javascript" src="../JScript/jquery-1.4.2.min.js"></script>
		<script language="javascript">
		var bClosing;
		
			function nodeSelect(node)
			{
				var result;  				
  				var tabSelectedId;
  				var position;
  				var tmp;
  				var i;
  				var obj;
  				var data;
  				var virtualDir;
  				var dir;
  				
  				
  				var selectedItem = node.path;
  				
  				
  				if(selectedItem != undefined && selectedItem != null && selectedItem != "")
  				{
  					result = new PageSelectorResult(true);
  					result.selectedId = selectedItem;
  					result.position = "inside";
  						  				
  					window.returnValue = result;
						
					bClosing = true;
					window.close();
				}
  				
			}
			
			
		
			function PageSelectorResult(returnValue)
			{
			
				this.returnValue = returnValue;
				this.selectedId = null;
				this.position = null;
			}
						
			function Loaded()
			{
				var curHeight;
				var treeRoute;
				var routeIds;
				var tabId;
				var tree;
				var id;
				var nodes;
				var bfind;

				bClosing = false;
				window.returnValue = false;
				
				curHeight = parseInt(window.dialogHeight);
				curHeight = curHeight + document.body.firstChild.offsetHeight - document.body.clientHeight;
				window.dialogHeight = curHeight + 'px';
			}
			
			function Cancel()
			{
				window.close();
			}

			function UnLoading()
			{
				bClosing = true;
  			}
		</script>
		<script language="javascript" type="text/javascript">
		    $(document).ready(function() {
		        $("a.PageSelectorTreeItem").attr('href', '').each(
		            function(i, e) {
		                var fn = (function() {
		                    var id = e.id;
		                    $(e).click(function() {
		                        nodeSelect(document.getElementById(id));
		                        event.cancelBubble = true;
		                        return false;
		                    });
		                })();

		            });
		        $('TreeViewFrame').css("height", $('TreeViewFrame').height());
		    });
		</script>
	</HEAD>
	<body onload="Loaded()" onunload="UnLoading()">
		<form id="PageSelector" method="post" runat="server">
			<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
				<tr>
					<td vAlign="top" width="100%" height="32">
						<table height="32" cellSpacing="0" cellPadding="0" width="100%" border="0">
							<tr>
								<td align="left" width="154" background="<%= CrossFactory.SiteNote.Components.Utils._ApplicationPath + CrossFactory.SiteNote.Components.Settings._settings.VirtualPath %>/Admin/Images/Layout/TopBackground.gif" colSpan="2"
									height="19"><IMG height="19" src="<%= CrossFactory.SiteNote.Components.Utils._ApplicationPath + CrossFactory.SiteNote.Components.Settings._settings.VirtualPath %>/Admin/Images/Layout/TopLeft.gif" width="154"></td>
								<td align="right" width="100%" background="<%= CrossFactory.SiteNote.Components.Utils._ApplicationPath + CrossFactory.SiteNote.Components.Settings._settings.VirtualPath %>/Admin/Images/Layout/TopBackground.gif" height="32"
									rowSpan="2"><IMG height="32" src="<%= CrossFactory.SiteNote.Components.Utils._ApplicationPath + CrossFactory.SiteNote.Components.Settings._settings.VirtualPath %>/Admin/Images/Layout/logo.gif" width="165"></td>
							</tr>
							<tr height="13">
								<td width="7" background="<%= CrossFactory.SiteNote.Components.Utils._ApplicationPath + CrossFactory.SiteNote.Components.Settings._settings.VirtualPath %>/Admin/Images/Layout/LeftBackgroundTop.gif" height="13"><IMG height="13" src="<%= CrossFactory.SiteNote.Components.Utils._ApplicationPath + CrossFactory.SiteNote.Components.Settings._settings.VirtualPath %>/Admin/Images/transp.gif" width="7"></td>
								<td width="147" height="13"><IMG height="13" src="<%= CrossFactory.SiteNote.Components.Utils._ApplicationPath + CrossFactory.SiteNote.Components.Settings._settings.VirtualPath %>/Admin/Images/transp.gif" width="147"></td>
							</tr>
						</table>
					</td>
				</tr>
				<tr height="100%">
					<td vAlign="top" width="100%" height="100%">
						<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
							<tr>
								<td width="7" background="<%= CrossFactory.SiteNote.Components.Utils._ApplicationPath + CrossFactory.SiteNote.Components.Settings._settings.VirtualPath %>/Admin/Images/Layout/LeftBackgroundBottom.gif"><IMG height="1" src="<%= CrossFactory.SiteNote.Components.Utils._ApplicationPath + CrossFactory.SiteNote.Components.Settings._settings.VirtualPath %>/Admin/Images/transp.gif" width="7"></td>
								<td id="PageSelectorContent" vAlign="top" align="left" width="100%" height="100%">
								    <div style="overflow:auto; height: 100%;" id="TreeViewFrame">
									<asp:TreeView id="TreeView1" Height="100%" Width="330" KeyboardEnabled="true" CssClass="TreeView" NodeStyle-CssClass="PageSelectorTreeItem" 
									    SelectedNodeStyle-CssClass="PageSelectorTreeItemSelected" 
									    HoverNodeStyle-CssClass="PageSelectorTreeItemOver"
										LineImageWidth="19" LineImageHeight="20" ItemSpacing="0" NodeLabelPadding="3"
										ShowLines="true" LineImagesFolder="../Admin/Images/PageSelector/lines/" runat="server" ClientSideOnNodeSelect="nodeSelect"></asp:TreeView>
							        </div>
								</td>
								<td width="11" background="<%= CrossFactory.SiteNote.Components.Utils._ApplicationPath + CrossFactory.SiteNote.Components.Settings._settings.VirtualPath %>/Admin/Images/Layout/RightBackground.gif"><IMG height="1" src="Images/transp.gif" width="11"></td>
							</tr>
						</table>
					</td>
				</tr>
				<tr height="40">
					<td>
						<table height="100%" cellSpacing="0" cellPadding="0" border="0">
							<tr>
								<td height="8"><IMG src="<%= CrossFactory.SiteNote.Components.Utils._ApplicationPath + CrossFactory.SiteNote.Components.Settings._settings.VirtualPath %>/Admin/Images/Layout/FooterLeft.gif"></td>
								<td width="100%">
									<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">
										<tr>
											<td width="100%" background="<%= CrossFactory.SiteNote.Components.Utils._ApplicationPath + CrossFactory.SiteNote.Components.Settings._settings.VirtualPath %>/Admin/Images/Layout/FooterCenter.gif" height="8"></td>
											<td height="8"><IMG height="8" src="<%= CrossFactory.SiteNote.Components.Utils._ApplicationPath + CrossFactory.SiteNote.Components.Settings._settings.VirtualPath %>/Admin/Images/Layout/FooterRight.gif" width="255"></td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td align="right" width="100%" colSpan="3">
									<table style="BACKGROUND: url(<%= CrossFactory.SiteNote.Components.Utils._ApplicationPath + CrossFactory.SiteNote.Components.Settings._settings.VirtualPath %>/Admin/Images/Layout/Footer.gif) no-repeat right 50%" height="100%"
										width="100%" border="0">
										<tr>
											<td width="100%"></td>
											<td><input id=cancelButton style="WIDTH: 100px" onclick=Cancel() type=button value='Cancel'></td>
											<td width="1"></td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</form>
	</body>
</HTML>
